package com.company.cloud.product.modules.api.response;

import java.util.ArrayList;
import java.util.List;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ProductCategoryModel {

	@ApiModelProperty(value = "ID")
	private Integer id;

	@ApiModelProperty(value = "公司编号")
	private String companyNo;

	@ApiModelProperty(value = "语言分类")
	private String langType;

	@ApiModelProperty(value = "名称")
	private String name;

	@ApiModelProperty(value = "图片")
	private String img;

	@ApiModelProperty(value = "排序")
	private Integer orders;

	@ApiModelProperty(value = "备注")
	private String remark;

	@ApiModelProperty(value = "层级")
	private Integer grade;

	@ApiModelProperty(value = "树路径")
	private String treePath;

	@ApiModelProperty(value = "上级分类")
	private Integer parentId;

	@ApiModelProperty(value = "商品配置分类ID")
	private Integer configId;

	@ApiModelProperty(value = "入驻须知")
	private String instructions;

	@ApiModelProperty(value = "子分类")
	private List<ProductCategoryModel> children;

	public void addChildren(ProductCategoryModel model) {
		if (this.children == null) {
			this.children = new ArrayList<ProductCategoryModel>();
		}
		this.children.add(model);
	}

}
